Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DropZone Preview on Rails 6.0.x #263

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

ohrite
Copy link
Contributor

@ohrite ohrite commented Aug 27, 2022

Why make this change?

On Rails 6.0, ActionView::Helpers::TagHelper handles tag.div(class: ["class-1", "class-2": true]) differently than Rails 7. This results in an invalid class string rendered into the DropZone preview template.

The class in question:
Screen Shot 2022-08-27 at 16 15 47

Before preview:
Screen Shot 2022-08-27 at 16 13 27

After preview:
Screen Shot 2022-08-27 at 16 19 32

What changed in this pull request?

This pull request uses a hash, rather than an array with a nested hash, to calculate the CSS classes for the DropZone Preview.

Tasks

  • Code is tested
  • Root cause is described
  • Screenshots are attached

* This adds Rails 6.0 compatibility for a change in CSS class calculation in ActionView::Helpers::TagHelper
@ohrite
Copy link
Contributor Author

ohrite commented Aug 27, 2022

Hi @kirillplatonov! We're fans of your gem here at @minifast. Thanks for all your hard work! I've got a Rails 6.0 backwards compatibility fix for the DropZone component. Please let me know if there are any desired changes!

@ohrite ohrite changed the title Fix DropZone Preview Fix DropZone Preview on Rails 6 Aug 27, 2022
@ohrite ohrite changed the title Fix DropZone Preview on Rails 6 Fix DropZone Preview on Rails 6.0.x Aug 27, 2022
@kirillplatonov
Copy link
Collaborator

@ohrite thanks for the contribution 👏

@kirillplatonov kirillplatonov merged commit d0200d8 into baoagency:main Aug 28, 2022
@ohrite ohrite deleted the fix-preview-padding branch August 29, 2022 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants